Skip to content

fix: optimize parsing V3.1 documents by reducing GetLocation method allocation on hot path(#2748)#2750

Merged
baywet merged 1 commit intosupport/v2from
fix/perf-to-v2
Feb 25, 2026
Merged

fix: optimize parsing V3.1 documents by reducing GetLocation method allocation on hot path(#2748)#2750
baywet merged 1 commit intosupport/v2from
fix/perf-to-v2

Conversation

@baywet
Copy link
Member

@baywet baywet commented Feb 24, 2026

port of #2748

…llocation on hot path(#2748)

* chore: Refresh benchmarks

* test: Add GHES Next descriptions

* perf: ParsingContext.GetLocation

* perf: Only load node location when needed

* perf: Update GetLocation implementation
@baywet baywet requested a review from a team as a code owner February 24, 2026 21:24
@baywet baywet self-assigned this Feb 24, 2026
@baywet baywet enabled auto-merge February 24, 2026 21:24
Comment on lines +192 to +198
}
}

char[] rentedBuffer = ArrayPool<char>.Shared.Rent(totalLength);

try
{

Check notice

Code scanning / CodeQL

Missed opportunity to use Where Note

This foreach loop
implicitly filters its target sequence
- consider filtering the sequence explicitly using '.Where(...)'.

Copilot Autofix

AI 1 day ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@baywet baywet merged commit 91e697b into support/v2 Feb 25, 2026
16 of 17 checks passed
@baywet baywet deleted the fix/perf-to-v2 branch February 25, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants